home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
lisp
/
kcl
/
akcl
/
akcl1615.lha
/
doc
/
volatile
< prev
Wrap
Lisp/Scheme
|
1987-11-24
|
1KB
|
49 lines
(trace t2defun)
(defun foo (x) (catch 'joe (loop (goo ))) x)
Changes necessary because any variables which want to live past a setjmp
must be declared volatile. This includes things like "base". Otherwise
the compiler is free to trash these, according to ANSI C.
(devar *volatile*)
add info-volatile slot to info
any c1 form that can lay down a setjmp does (setq *volatile* t).
any c1 form that does bindings, binds *volatile* = nil
and then on exit sets its info to have info-volatile.
on pass 2 and 3, the info-volatile is examined, and if t then
VOL is added to the appropriate declares.
(defun t1defun &aux *volatile*
.....
..
(setf (info-volatile info) *volatile*)
)
(defun c1catch ..(setq *volatile* t))
Then t3defun, c2let, c2let*,.. and other forms which lay down bindings,
must use the info-volatile information, when writing out their bindings,
adding a VOL before rep-type.
h/object.h
h/cmpinclude.h
will have a
#ifndef VOL
#define VOL
#endif
then for gcc you would use
CC = gcc -DVOL=volatile